import { DefineComponent } from 'vue'
export interface IFormItemTypes {
  type: DefineComponent<{}, {}, any> | string
  Options?: { label: string; value: string }[]
  class?: string
  disabled?: boolean
  modelValue?: string
  label?: string
  size?: string
  index: number
  isTree?:boolean
  outputkey?: string
  placeholder:string
  handelEvent?:(storeId:string,nodeType:string)=>void
  handelDeleceEvent?:(storeId:string,index:number,conditionsIndex:number)=>void
}
export interface IOutputItem {
  name: string;
  type: string;
  required: boolean;
  description: string;
  Options?: { label: string; value: string }[];
  size?: number;
  check: boolean;
  variable?:string;
  handelEvent?:()=>void;
}
export interface Item {
  id: string
  type: any
  props: ItemProps
  actions?: any[]
  Options: []
  children?: ItemProps[]
}
export interface ItemProps {
  class?: string
  Options?: any
  modelValue?: any
  defaultValue?: any
  actions?: string
  disabled?: boolean
}

export interface Option {
  groupName?:string
  label?: string
  value?: string
  options?: Option[]
  id?:string
}

export interface OutputItem {
  name: string
}

export interface NodeData {
  title?: string
  label?: string
  output?: OutputItem[]
}

export interface Node {
  id: string
  data: NodeData
}

export interface IEdge {
  source: string
  target: string
}

export interface ReferenceOption {
  groupName: string
  Options: Option[]
}

export interface IRootInterface {
  id: string;
  type: string;
  source: string;
  target: string;
  sourceHandle?: any;
  targetHandle?: any;
  data: any;
  events: any;
  label: string;
  sourceNode: SourceNode;
  targetNode: TargetNode;
  sourceX: number;
  sourceY: number;
  targetX: number;
  targetY: number;
}

export interface TargetNode {
  id: string;
  type: string;
  dimensions: Dimensions;
  computedPosition: ComputedPosition;
  handleBounds: HandleBounds2;
  selected: boolean;
  dragging: boolean;
  resizing: boolean;
  initialized: boolean;
  isParent: boolean;
  position: Position;
  data: Data3;
  events: any;
  label: string;
}

export interface Data3 {
  title: string;
}

export interface HandleBounds2 {
  source: Source[];
  target: Source[];
}

export interface SourceNode {
  id: string;
  type: string;
  dimensions: Dimensions;
  computedPosition: ComputedPosition;
  handleBounds: HandleBounds;
  selected: boolean;
  dragging: boolean;
  resizing: boolean;
  initialized: boolean;
  isParent: boolean;
  position: Position;
  data: Data2;
  events: any;
  label: string;
}

export interface Data2 {
  id: string;
  type: string;
  title: string;
  description: string;
  properties: Properties;
  labels: Label[];
  output: Output[];
}

export interface Output {
  name: string;
  type: string;
  description: string;
  required: boolean;
  action?: number;
}

export interface Label {
  type: string;
  label: string;
  key: string;
  class: string;
}

export interface Properties {
  json: Json;
}

export interface Json {
  icon: string;
  size: number;
  color: string;
}

export interface Position {
  x: number;
  y: number;
}

export interface HandleBounds {
  source: Source[];
  target: any[];
}

export interface Source {
  id?: any;
  position: string;
  x: number;
  y: number;
  width: number;
  height: number;
}

export interface ComputedPosition {
  x: number;
  y: number;
  z: number;
}

export interface Dimensions {
  width: number;
  height: number;
}

export interface IfNodeRoot {
  id: string;
  type: string;
  data: IfNodeData;
}

export interface IfNodeData {
  title: string;
  description: string;
  properties: Properties;
  labels: Label[];
  branchs: Branch[];
  transition: string;
}
export interface Branch {
  conditions?: Condition[];
  logical: string;
  transition: string;
  id:string;
}

export interface Condition {
  left: Left;
  relational: string;
  right: Left;
}

export interface Left {
  ref: string;
  category: string;
  value: string;
}

